package com.vodafone.mapreduce.dto.function;

import java.io.Serializable;

import com.vodafone.mapreduce.MapReduce;

/**
 * Input for the divide function. This divide function will chunk the input kvp into 1..n kvps.
 * 
 * @param <K>
 * @param <V>
 */
public class DivideInput<K, V> implements Serializable {

    // -------------------------------------------------------------------------------------------------------------------------------------
    // Class constants.
    // -------------------------------------------------------------------------------------------------------------------------------------

    private static final long serialVersionUID = MapReduce.SERIAL_VERSION_UID;

    // -------------------------------------------------------------------------------------------------------------------------------------
    // Instance attributes.
    // -------------------------------------------------------------------------------------------------------------------------------------

    private K k;
    private V v;

    // -------------------------------------------------------------------------------------------------------------------------------------
    // Instance constructors.
    // -------------------------------------------------------------------------------------------------------------------------------------

    public DivideInput() {
    }

    public DivideInput(K k, V v) {
        this.k = k;
        this.v = v;
    }

    // -------------------------------------------------------------------------------------------------------------------------------------
    // Instance methods.
    // -------------------------------------------------------------------------------------------------------------------------------------

    public K getKey() {
        return k;
    }

    public V getValue() {
        return v;
    }

    public void setKey(K k) {
        this.k = k;
    }

    public void setValue(V v) {
        this.v = v;
    }

    public DivideInput<K, V> withKey(K k) {
        setKey(k);
        return this;
    }

    public DivideInput<K, V> withValue(V v) {
        setValue(v);
        return this;
    }

    // -------------------------------------------------------------------------------------------------------------------------------------

}
